//配置所有用户权限访问的页面路由
//要配出最高权限的路由，后面会再计算不同权限的用户可显示的路由
const allRoutes = [
  {
    path: "welcome",
    name: "Welcome",
    component: () =>
      import(/*webpackChunkName:"Welcome"*/ "@/pages/home/Welcome"),
    //路由元信息，图标、完整地址、名字
    meta: {
      icon: "iconfont el-icon-s-shop", //前面是固定的类名，后面是图标库里选中的类名
      fullPath: "/welcome", //全路径
      name: "管理首页", //name是后端设定好的，要和后端数据一致，因为后面要通过这个名字来遍历出不同权限的用户所显示出来的路由页面
    },
  },
  {
    path: "studentmanager",
    name: "Studentmanager",
    component: () =>
      import(
        /*webpackChunkName:"Studentmanager"*/ "@/pages/home/StudentManager"
      ),
    redirect: "/studentmanager/product",
    meta: {
      icon: "iconfont el-icon-user-solid",
      fullPath: "/studentmanager",
      name: "学员管理",
    },
    children: [
      {
        path: "product",
        name: "Product",
        component: () =>
          import(
            /*webpackChunkName:"Product"*/ "@/pages/home/StudentManager/Product"
          ),
        meta: {
          icon: "iconfont el-icon-shopping-bag-2",
          fullPath: "/studentmanager/product", //children的全路径要加上上级路径
          name: "学员项目管理",
        },
      },
      {
        path: "information",
        name: "Information",
        component: () =>
          import(
            /*webpackChunkName:"Information"*/ "@/pages/home/StudentManager/Information"
          ),
        meta: {
          icon: "iconfont el-icon-document",
          fullPath: "/studentmanager/information",
          name: "学员资料",
        },
      },
      {
        path: "dormitory",
        name: "Dormitory",
        component: () =>
          import(
            /*webpackChunkName:"Dormitory"*/ "@/pages/home/StudentManager/Dormitory"
          ),
        meta: {
          icon: "iconfont el-icon-office-building",
          fullPath: "/studentmanager/dormitory",
          name: "学员宿舍",
        },
      },
    ],
  },
  {
    path: "attendance",
    name: "Attendance",
    component: () =>
      import(/*webpackChunkName:"Attendance"*/ "@/pages/home/Attendance"),
    meta: {
      icon: "iconfont el-icon-date",
      fullPath: "/attendance",
      name: "考勤管理",
    },
  },
  {
    path: "users",
    name: "Users",
    component: () => import(/*webpackChunkName:"Users"*/ "@/pages/home/Users"),
    meta: {
      icon: "iconfont el-icon-user",
      fullPath: "/users",
      name: "用户管理",
    },
  },
  {
    path: "statistics",
    name: "Statistics",
    component: () =>
      import(/*webpackChunkName:"Statistics"*/ "@/pages/home/Statistics"),
    meta: {
      icon: "iconfont el-icon-s-data",
      fullPath: "/statistics",
      name: "数据统计",
    },
  },
  {
    path: "mine",
    name: "Mine",
    component: () => import(/*webpackChunkName:"Mine"*/ "@/pages/home/Mine"),
    meta: {
      icon: "iconfont el-icon-s-custom",
      fullPath: "/mine",
      name: "我的中心",
    },
  },
];

export default allRoutes;
